package com.ks.config.starter.controller.rpc;

import com.ks.config.service.rpc.FeignClientService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class FeignClientController {

    @Resource
    private FeignClientService feignClientService;

    /**
     * FeignClient 方式调用rpc方法
     *
     * @return
     */
    @RequestMapping("/feignClientConnect/{name}")
    @ResponseBody
    public String feignClientConnect(@PathVariable(value = "name") String name) {
        String result = feignClientService.feignClientConnect(name);
        System.out.println("result=" + result);
        return result;
    }
}
